Skip to main content

Purchase Orders

Frequency:

Purchase order data and changes are required to be sent in near real-time.

Expected data:

Purchase order document to be created or updated.

Technical:

If a purchase order does not exist in DSWMS, it will be created.

If a purchase order already exists in DSWMS, the existing document will be updated with the new data.

An update is only possible until the start of the receive process on the DSWMS side for the respective purchase order.


POST https://{url}/v1/orders/purchase

Create or update a purchase order.

Request Body

The request body is a JSON object containing purchase order header fields and a details array with the order lines.

Purchase order fields:

NameTypeRequiredDescription
idstringYesPO unique identifier in ERP
type_idintegerNoPO type: 1 - Regular, 2 - JIT, 3 - XDOCK, 4 - Empties return, 5 - Material return
split_group_idstringYesSplit group unique identifier in ERP
plant_idstringYesPlant unique identifier in ERP
supplier_idstringYesSupplier unique identifier in ERP
supplier_namestringYesSupplier name
order_datestringYesPO order date
delivery_datestringYesPO delivery date
proposal_order_idstringNoProposal order identifier from DSO
detailsarrayYesArray of detail line objects for the purchase order

Detail object (inside details array):

NameTypeRequiredDescription
line_numberintegerYesPO detail line number
article_idstringYesArticle unique identifier in ERP
min_purchase_shelf_lifestringYesMinimum shelf life allowed to receive
quantitynumberYesPO detail ordered quantity
quantity_unit_type_idintegerYesPO detail quantity unit type: 1 - base unit, 2 - warehouse unit, 3 - layer unit, 4 - pallet unit

Request Example

{
"id": "3000437294",
"type_id": 1,
"split_group_id": "1015",
"plant_id": "102849",
"supplier_id": "917923956",
"supplier_name": "Coca Cola Latvia SIA",
"order_date": "1603979144",
"delivery_date": "1604340600",
"proposal_order_id": "1234567",
"details": [
{
"line_number": 100,
"article_id": "0001",
"min_purchase_shelf_life": "1605000600",
"quantity": 144,
"quantity_unit_type_id": 1
},
{
"line_number": 200,
"article_id": "0047",
"min_purchase_shelf_life": "1606023000",
"quantity": 60,
"quantity_unit_type_id": 2
}
]
}

Response

200: OK — Success

{
"success": true,
"message": null
}

400: Bad Request — Error

{
"success": false,
"message": "Reception has already started"
}